home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2470 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: noc.tor.hookup.net!the-fix.sos.on.ca
  2. From: <verneb@the-fix.sos.on.ca>
  3. Date: Sun,21 Jan 96 14:45:06 -0500
  4. Newsgroups: comp.lang.c
  5. Subject: Help: floating point/use of floor
  6. Message-ID: <tcpnntpd.16.1.21.14.45.6.2781597121.352666@the-fix.sos.on.ca>
  7. References: <4dogri$fta@gate.service.britgas.co.uk>
  8. Organization: the FIX - Kitchener, Ontario CANADA
  9. NNTP-Posting-Host: the-fix.sos.on.ca
  10. X-MajorTCP-Version: MajorTCP/IP [1.81-5]
  11.  
  12. To: INT:andy.crutchlow@servic
  13.  
  14. Int:andy.crutchlow@servic,
  15.  
  16. I>Can anyone help.
  17. I>
  18. I>Make the following display 75.99
  19. I>main()
  20. I>{
  21. I>int i; /*change to float i;
  22. I>float f;
  23. I>i = 7599;
  24. I>f = i / 100.00;
  25. I>printf("%f\n",f);/*change to:- printf("%.2f %.2f\n", i, f);
  26.     /* here add:- return 0;
  27. I>}
  28. I>/* this should work for you now!*/
  29. I>I believe the correct answer involves using function floor but I can't
  30. I>remember how.
  31. I>
  32. I>Thanks.
  33. I>e-mail:- andy.crutchlow@service.britgas.co.uk
  34. I>
  35. I>                                                                       
  36.  
  37. Verne H. Bohlender
  38. Box 416, Chesley, Ontario.Ca. N0G 1L0
  39. verneb@The-Fix.sos.on.ca
  40. ___
  41. * UniQWK #2158*
  42.  
  43.